package com.learn.yh.aws;

import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;

/**
 * @author: Yh
 * @date: 2021/4/6 14:58
 */
public class YamlCredentialsProvider implements AWSCredentialsProvider {
    private AWSCredentials credentials;

    public static YamlCredentialsProvider of(AwsSecretProperties.Property aws) {
        YamlCredentialsProvider target = new YamlCredentialsProvider();
        target.credentials = YamlCredentials.of(aws);
        return target;
    }

    @Override
    public AWSCredentials getCredentials() {
        return credentials;
    }

    @Override
    public void refresh() {
    }

}
